package org.example.y24.m10;

public class CarExample {
    public static void main(String[] args) {
        Car car = new Car();
        car.run();

    }

    /**
     * 汽车对象
     */
    static class Car{
        private Framework framework;
        public Car(){
            framework = new Framework();
            System.out.println("Car init...");
        }
        public void run(){
            System.out.println("Car run");
        }

    }

    /**
     * 车身类
     */
    static class Framework{
        private Bottom bottom;

        public Framework() {
            bottom = new Bottom();
            System.out.println("Framework init...");
        }
    }

    /**
     * 底盘类
     */
    static class Bottom{
        private Tire tire;
        public Bottom(){
            this.tire = new Tire();
            System.out.println("Bottom init...");
        }
    }

    /**
     * 轮胎类
     */
    static class Tire{
        private int size;//尺寸
        public Tire(){
            this.size = 10;
            System.out.println("轮胎尺寸--->" + size);
        }

    }

}
